package com.yu.proxy.staticproxy;

import com.yu.proxy.Calculator;

/**
 * @author yushijun
 * @date 2018/6/29
 * 静态代理
 */
public class CalculatorProxy implements Calculator {

    private Calculator calculator;
    public CalculatorProxy(Calculator calculator) {
        this.calculator=calculator;
    }
    @Override
    public int add(int a, int b) {
        //执行一些操作
        System.out.println("begin ");
        int result = calculator.add(a, b);
        System.out.println("end ");
        return result;
    }
}
